<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<style type="text/css">
<!--
#message{background:#006699; color:#FFFFFF};

-->
</style>
<body>

<div id="message">
<span><b>操作内容：</b></span>
</div>
<!-- The data encoding type, enctype, MUST be specified as below -->
<form  id="form1" enctype="multipart/form-data" action="execute.php"  method="POST">
    <p>
    <!-- MAX_FILE_SIZE must precede the file input field -->
    <input type="hidden" name="MAX_FILE_SIZE" value="3000000" />
    <!-- Name of input element determines name in $_FILES array -->
    Send this file: 
    <input name="userfile" type="file" />
    <input type="hidden" name="action" value="update" />
    <input type="submit" value="Send File" />
    </p>
    <p>待处理的文件
      <input type="text" name="fn" value="" />
      <input type="text" name="id" value="12"/>
    </p>
</form>
<script type="text/javascript" >
var url=location.href;
var pos = url.indexOf('#')+1;
var pos2 = url.indexOf('#',pos)+1;
var diff = pos2 -pos - 1 ;
var ss = url.substr(pos,diff); 
var id = url.substr(pos2);


document.getElementById('form1').fn.value = ss;
document.getElementById('form1').id.value = id;

if(ss=="add")
{
 	document.getElementById('form1').action.value ="add";
	document.getElementById('message').innerHTML += "<span>add a file</span>";
}
else
{
	document.getElementById('form1').action.value ="update";
	document.getElementById('message').innerHTML += "<span>update a file</span>";
}

//alert(document.getElementById('form1').action.value );
//alert(document.getElementById('form1').fn.value);


</script>

</body>
</html>
